<!-- display a summary version of what users have requested and offered -->
<!-- requires locals :challenge_collection :tag_type :summary_tags :generated_live -->
<h2><%= ts("Signup Summary for %{challenge_collection}", :challenge_collection => challenge_collection.title) %></h2>

<% unless generated_live %>
  <p>
    <%= ts("Last generated at:") %> <%= time_in_zone(Time.now, (challenge_collection.challenge.time_zone || Time.zone.name)) %>
    <%= ts("(Generated hourly on request while signups are open.)") %>
  </p>
<% end %>

<h3><%= ts("Requested %{tag_type}", :tag_type => tag_type.pluralize.capitalize) %></h3>

<p class="note">
  Key: <strong><span class="requested offered"><%= tag_type.capitalize %></span> 
       [<span class="requested"># requests</span>, <span class="offered"># offers</span>]</strong>, 
       listed by fewest offers and most requests
</p>

<ul>
  <% summary_tags.each do |tag| %>
    <li class="requested">
      <span class = "<%= tag.requests > 0 ? 'requested' : ''%> <%= tag.offers > 0 ? 'offered' : '' %>">
        <%= tag.name %>
      </span>
      [<span class="requested"><%= tag.requests.to_i -%></span>,
      <span class="offered"><%= tag.offers.to_i -%></span>]
    </li>
  <% end %>
</ul> 

